package com.xiaoa.gossip.cluster.task;

import com.xiaoa.gossip.cluster.service.ClusterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author luokaichuang
 * @time 2020/5/14
 */
@Component
public class PingTask {

    @Autowired
    private ClusterService clusterService;

    @Scheduled(initialDelay = 0,fixedDelay = 1500)
    public void pingTask() {
        clusterService.doPingToNeighbor();
    }


}
